home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / stabilzr.sit / The Stabilizer / card_12512.txt < prev    next >
Text File  |  1989-02-05  |  15KB  |  584 lines

  1. -- card: 12512 from stack: in
  2. -- bmap block id: 15974
  3. -- flags: 4000
  4. -- background id: 2175
  5. -- name: TryIt
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   put "Auto Insurance" &return& "Electricity" &return& "House Payment" into card field "expenseDemo"
  9.   put "$346.57" &return& "$52.84" &return& "$746.00" into card field "amountDemo"
  10.   hide button "demo"
  11.   repeat with i = 5 to 11
  12.     if the visible of card field i = true then hide card field i
  13.   end repeat
  14. end closeCard
  15.  
  16. on mouseUp
  17.   show card field "buttonHelp"
  18.   show button "demo"
  19.   repeat until the mouseClick
  20.   end repeat
  21.   get the mouseLoc
  22.   hide button "demo"
  23.   hide card field "buttonHelp"
  24.   if item 1 of it > 235 and item 1 of it < 275 and item 2 of it >306 and item 2 of it < 339 then send mouseUp to button "Go Back"
  25. end mouseUp
  26.  
  27. on arrowKey direction
  28.   if direction is "right" then
  29.     go last card
  30.   else
  31.     pass arrowKey
  32.   end if
  33. end arrowkey
  34.  
  35.  
  36.  
  37. -- part 1 (field)
  38. -- low flags: 01
  39. -- high flags: 4002
  40. -- rect: left=20 top=56 right=297 bottom=181
  41. -- title width / last selected line: 0
  42. -- icon id / first selected line: 0 / 0
  43. -- text alignment: 0
  44. -- font id: 3
  45. -- text size: 12
  46. -- style flags: 0
  47. -- line height: 16
  48. -- part name: expenseDemo
  49. ----- HyperTalk script -----
  50. on mouseDown
  51.   demoItems
  52. end mouseDown
  53.  
  54. on demoItems
  55.   put (item 2 of the mouseLoc - 39) div 16 into whichLine
  56.   put the short name of the target into whichField
  57.   if line whichLine of card field whichField is empty then exit demoItems
  58.   get line whichLine of card field whichField
  59.   repeat with i = 1 to the number of lines in card field "demoData"
  60.     if it = item 1 of line i of card field "demoData" then
  61.       put line i of card field "demoData" into theList
  62.       exit repeat
  63.     end if
  64.   end repeat
  65.  
  66.   if it = "Auto Insurance" then put line 1 of card field "amountDemo" into item 2 of theList
  67.   if it = "Electricity" then put line 2 of card field "amountDemo" into last word of item 4 of theList
  68.   if it = "House Payment" then put line 3 of card field "amountDemo" into item 2 of theList
  69.  
  70.   if item 3 of theList = "Every Month" then put "," & card field "monthList" of card "Expenses" after theList
  71.  
  72.   put the mouseloc into listHere
  73.   put item 1 of listHere + 1 into horiz
  74.   put item 2 of listHere - 10 into vert
  75.   get the number of items in theList
  76.   put vert + (it * 17) into length
  77.   if length > 314 then subtract (length - 324) from vert
  78.   get PopUpMenu(theList, 1, vert, horiz)
  79.   put item it of theList into sayWhat
  80.   if it = 1 then
  81.     show card field "itemHelp"
  82.     repeat until the mouseClick
  83.     end repeat
  84.     hide card field "itemHelp"
  85.   else
  86.     if it > 2 then
  87.       show card field "monthHelp"
  88.       repeat until the mouseClick
  89.       end repeat
  90.       hide card field "monthHelp"
  91.     else if it = 2 then
  92.       show card field "nothing"
  93.       repeat until the mouseClick
  94.       end repeat
  95.       hide card field "nothing"
  96.     end if
  97.   end if
  98. end demoItems
  99.  
  100. on mouseUp
  101. end mouseUp
  102.  
  103.  
  104.  
  105.  
  106. -- part 2 (field)
  107. -- low flags: 01
  108. -- high flags: 4002
  109. -- rect: left=180 top=56 right=297 bottom=256
  110. -- title width / last selected line: 0
  111. -- icon id / first selected line: 0 / 0
  112. -- text alignment: 65535
  113. -- font id: 3
  114. -- text size: 12
  115. -- style flags: 0
  116. -- line height: 16
  117. -- part name: amountDemo
  118. ----- HyperTalk script -----
  119. on mouseUp
  120. end mouseUp
  121.  
  122.  
  123.  
  124. -- part 3 (field)
  125. -- low flags: 01
  126. -- high flags: 0000
  127. -- rect: left=256 top=56 right=297 bottom=417
  128. -- title width / last selected line: 0
  129. -- icon id / first selected line: 0 / 0
  130. -- text alignment: 0
  131. -- font id: 3
  132. -- text size: 12
  133. -- style flags: 0
  134. -- line height: 16
  135. -- part name: expense2Demo
  136. ----- HyperTalk script -----
  137. on mouseUp
  138. end mouseUp
  139.  
  140.  
  141.  
  142. -- part 4 (field)
  143. -- low flags: 01
  144. -- high flags: 4002
  145. -- rect: left=416 top=56 right=297 bottom=492
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 0 / 0
  148. -- text alignment: 65535
  149. -- font id: 3
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: amount2Demo
  154. ----- HyperTalk script -----
  155. on mouseUp
  156. end mouseUp
  157.  
  158.  
  159.  
  160. -- part 6 (field)
  161. -- low flags: 81
  162. -- high flags: 0000
  163. -- rect: left=55 top=124 right=259 bottom=368
  164. -- title width / last selected line: 0
  165. -- icon id / first selected line: 0 / 0
  166. -- text alignment: 0
  167. -- font id: 3
  168. -- text size: 12
  169. -- style flags: 0
  170. -- line height: 16
  171. -- part name: demoData
  172.  
  173.  
  174. -- part 7 (field)
  175. -- low flags: 81
  176. -- high flags: 2004
  177. -- rect: left=105 top=43 right=179 bottom=427
  178. -- title width / last selected line: 0
  179. -- icon id / first selected line: 0 / 0
  180. -- text alignment: 0
  181. -- font id: 3
  182. -- text size: 12
  183. -- style flags: 0
  184. -- line height: 16
  185. -- part name: itemHelp
  186. ----- HyperTalk script -----
  187. on mouseUp
  188.   hide the target
  189. end mouseUp
  190.  
  191.  
  192.  
  193. -- part 8 (field)
  194. -- low flags: 81
  195. -- high flags: 2004
  196. -- rect: left=105 top=43 right=118 bottom=427
  197. -- title width / last selected line: 0
  198. -- icon id / first selected line: 0 / 0
  199. -- text alignment: 0
  200. -- font id: 3
  201. -- text size: 12
  202. -- style flags: 0
  203. -- line height: 16
  204. -- part name: monthHelp
  205. ----- HyperTalk script -----
  206. on mouseUp
  207.   hide the target
  208. end mouseUp
  209.  
  210.  
  211.  
  212. -- part 9 (field)
  213. -- low flags: 81
  214. -- high flags: 2004
  215. -- rect: left=105 top=44 right=103 bottom=427
  216. -- title width / last selected line: 0
  217. -- icon id / first selected line: 0 / 0
  218. -- text alignment: 0
  219. -- font id: 3
  220. -- text size: 12
  221. -- style flags: 0
  222. -- line height: 16
  223. -- part name: nothing
  224. ----- HyperTalk script -----
  225. on mouseUp
  226.   hide the target
  227. end mouseUp
  228.  
  229.  
  230.  
  231. -- part 10 (button)
  232. -- low flags: 00
  233. -- high flags: 2000
  234. -- rect: left=195 top=18 right=37 bottom=280
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 0 / 0
  237. -- text alignment: 1
  238. -- font id: 0
  239. -- text size: 12
  240. -- style flags: 0
  241. -- line height: 16
  242. -- part name: demoEnter Item
  243. ----- HyperTalk script -----
  244. on mouseUp
  245.   show card field "demoEnter"
  246.   repeat until the mouseClick
  247.   end repeat
  248.   get the mouseLoc
  249.   hide card field "demoEnter"
  250.   if item 1 of it > 235 and item 1 of it < 275 and item 2 of it >306 and item 2 of it < 339 then send mouseUp to button "Go Back"
  251. end mouseUp
  252.  
  253.  
  254.  
  255. -- part 11 (field)
  256. -- low flags: 81
  257. -- high flags: 2004
  258. -- rect: left=105 top=44 right=119 bottom=427
  259. -- title width / last selected line: 0
  260. -- icon id / first selected line: 0 / 0
  261. -- text alignment: 0
  262. -- font id: 3
  263. -- text size: 12
  264. -- style flags: 0
  265. -- line height: 16
  266. -- part name: demoEnter
  267. ----- HyperTalk script -----
  268. on mouseUp
  269.   hide the target
  270. end mouseUp
  271.  
  272.  
  273.  
  274. -- part 12 (button)
  275. -- low flags: 00
  276. -- high flags: 2000
  277. -- rect: left=280 top=18 right=37 bottom=370
  278. -- title width / last selected line: 0
  279. -- icon id / first selected line: 0 / 0
  280. -- text alignment: 1
  281. -- font id: 0
  282. -- text size: 12
  283. -- style flags: 0
  284. -- line height: 16
  285. -- part name: demoDelete Item
  286. ----- HyperTalk script -----
  287. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  288.  
  289. on mouseUp
  290.   if the optionKey is down then
  291.     answer "Delete all the  DEMO expense items?" with "Cancel" or "DEMO"
  292.     if it = "DEMO" then
  293.       put empty into card field "expenseDemo"
  294.       put empty into card field "amountDemo"
  295.     else
  296.       exit mouseUp
  297.     end if
  298.   else
  299.  
  300.     set loc of msg to 18,15
  301.     put "Please click on the DEMO item you want deleted"
  302.     set cursor to 3
  303.     repeat until the mouse is down
  304.     end repeat
  305.     put item 1 of the mouseLoc into temp1
  306.     put item 2 of the mouseLoc into temp2
  307.     if temp1 > 181 and temp1 < 256 then
  308.       hide msg
  309.       exit mouseUp
  310.     end if
  311.     if temp1 < 20 or temp1 >417 then
  312.       hide msg
  313.       exit mouseUp
  314.     end if
  315.     if temp1 >= 20 and temp1 <= 181 then
  316.       put "expenseDemo" into whichField
  317.     else
  318.       if temp1 >= 256 and temp1 <= 417 then
  319.         put "expense2Demo" into whichField
  320.       end if
  321.     end if
  322.     put (temp2 - 39) div 16 into whichLine
  323.     put line whichLine of card field whichField into whatExpense
  324.     if whatExpense Γëá empty then
  325.       answer "Delete expense item..." && whatExpense &&"?" with "Cancel" or "OK"
  326.       if it = "Cancel" then put empty into whatExpense
  327.     end if
  328.     if whatExpense = empty then
  329.       hide msg
  330.       exit mouseUp
  331.     end if
  332.     set cursor to 4
  333.     set loc of msg to 19,106
  334.     put "Please wait"
  335.     delete line whichLine of card field whichField
  336.     delete line whichLine of card field "amountDemo"
  337.     hide msg
  338.   end if
  339. end mouseUp
  340.  
  341.  
  342.  
  343. -- part 13 (button)
  344. -- low flags: 00
  345. -- high flags: 2000
  346. -- rect: left=370 top=18 right=37 bottom=482
  347. -- title width / last selected line: 0
  348. -- icon id / first selected line: 0 / 0
  349. -- text alignment: 1
  350. -- font id: 0
  351. -- text size: 12
  352. -- style flags: 0
  353. -- line height: 16
  354. -- part name: demoChange Amount
  355. ----- HyperTalk script -----
  356. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  357.  
  358. on mouseUp
  359.   set loc of msg to 18,15
  360.   put "Please click on the DEMO amount you want changed"
  361.   set cursor to 3
  362.   set numberFormat to "0.00"
  363.   repeat until the mouse is down
  364.   end repeat
  365.   hide msg
  366.   put item 1 of the mouseLoc into temp1
  367.   put item 2 of the mouseLoc into temp2
  368.   if temp1 >= 180 and temp1 <= 256 then
  369.     put "expenseDemo" into whichField
  370.     put "amountDemo" into whichField2
  371.   else
  372.     if temp1 >= 416 and temp1 <= 492 then
  373.       put "expense2Demo" into whichField
  374.       put "amount2Demo" into whichField2
  375.     else
  376.       hide msg
  377.       exit mouseUp
  378.     end if
  379.   end if
  380.   put (temp2 - 39) div 16 into whichLine
  381.   put line whichLine of card field whichField into whatExpense
  382.   put line whichLine of card field whichField2 into newAmount
  383.   if whatExpense = empty then
  384.     hide msg
  385.     exit mouseUp
  386.   end if
  387.   ask "Please enter the new amount for" && whatExpense with newAmount
  388.   if it = empty then
  389.     hide msg
  390.     exit mouseUp
  391.   else
  392.     if char 1 of it = "$" then delete char 1 of it
  393.     add 0 to it
  394.     put "$" & it into newAmount
  395.     if it = newAmount then
  396.       hide msg
  397.       exit mouseUp
  398.     end if
  399.   end if
  400.   set cursor to 4
  401.   set loc of msg to 19,106
  402.   put "Please wait"
  403.   put newAmount into line whichLine of card field whichField2
  404.   hide msg
  405. end mouseUp
  406.  
  407.  
  408.  
  409. -- part 14 (button)
  410. -- low flags: 00
  411. -- high flags: 2000
  412. -- rect: left=238 top=308 right=336 bottom=273
  413. -- title width / last selected line: 0
  414. -- icon id / first selected line: 0 / 0
  415. -- text alignment: 1
  416. -- font id: 0
  417. -- text size: 12
  418. -- style flags: 0
  419. -- line height: 16
  420. -- part name: Go Back
  421. ----- HyperTalk script -----
  422. on mouseUp
  423.   visual venetian blinds to gray
  424.   visual venetian blinds
  425.   pop card
  426. end mouseUp
  427.  
  428.  
  429.  
  430. -- part 15 (field)
  431. -- low flags: 81
  432. -- high flags: 2004
  433. -- rect: left=105 top=43 right=247 bottom=427
  434. -- title width / last selected line: 0
  435. -- icon id / first selected line: 0 / 0
  436. -- text alignment: 0
  437. -- font id: 3
  438. -- text size: 12
  439. -- style flags: 0
  440. -- line height: 16
  441. -- part name: buttonHelp
  442. ----- HyperTalk script -----
  443. on mouseUp
  444.   hide button "demo"
  445.   hide the target
  446. end mouseUp
  447.  
  448.  
  449.  
  450. -- part 16 (button)
  451. -- low flags: 80
  452. -- high flags: 0000
  453. -- rect: left=203 top=142 right=162 bottom=226
  454. -- title width / last selected line: 0
  455. -- icon id / first selected line: 16816 / 16816
  456. -- text alignment: 1
  457. -- font id: 0
  458. -- text size: 12
  459. -- style flags: 0
  460. -- line height: 16
  461. -- part name: demo
  462. ----- HyperTalk script -----
  463. on mouseUp
  464.   hide button "demo"
  465.   hide card field "buttonHelp"
  466. end mouseUp
  467.  
  468.  
  469.  
  470. -- part 17 (button)
  471. -- low flags: 00
  472. -- high flags: 0000
  473. -- rect: left=310 top=311 right=335 bottom=444
  474. -- title width / last selected line: 0
  475. -- icon id / first selected line: 0 / 0
  476. -- text alignment: 1
  477. -- font id: 0
  478. -- text size: 12
  479. -- style flags: 0
  480. -- line height: 16
  481. -- part name: New Button
  482. ----- HyperTalk script -----
  483. on mouseUp
  484. end mouseUp
  485.  
  486.  
  487.  
  488. -- part 18 (button)
  489. -- low flags: 00
  490. -- high flags: 0000
  491. -- rect: left=52 top=15 right=40 bottom=152
  492. -- title width / last selected line: 0
  493. -- icon id / first selected line: 0 / 0
  494. -- text alignment: 1
  495. -- font id: 0
  496. -- text size: 12
  497. -- style flags: 0
  498. -- line height: 16
  499. -- part name: Feb
  500. ----- HyperTalk script -----
  501. on mouseUp
  502. end mouseUp
  503.  
  504. on mouseDown
  505.   put the mouseloc into listHere
  506.   put item 1 of listHere + 1 into horiz
  507.   put item 2 of listHere - 10 into vert
  508.   put card field "monthList" of card "Expenses" into theList
  509.   get PopUpMenu(theList, 1, vert, horiz)
  510.   if it >= 1 then
  511.     show card field "monthHelp"
  512.     repeat until the mouseClick
  513.     end repeat
  514.     hide card field "monthHelp"
  515.   end if
  516. end mouseDown
  517.  
  518.  
  519.  
  520.  
  521. -- part 19 (field)
  522. -- low flags: 81
  523. -- high flags: 2004
  524. -- rect: left=30 top=108 right=292 bottom=247
  525. -- title width / last selected line: 0
  526. -- icon id / first selected line: 0 / 0
  527. -- text alignment: 0
  528. -- font id: 3
  529. -- text size: 12
  530. -- style flags: 0
  531. -- line height: 16
  532. -- part name: viewDemo
  533. ----- HyperTalk script -----
  534. on mouseUp
  535.   hide card field "viewDemo"
  536. end mouseUp
  537.  
  538.  
  539.  
  540. -- part contents for card part 6
  541. ----- text -----
  542. AUTO INSURANCE,$346.57,February,August
  543. ELECTRICITY,variable,January - $69.12,February - $52.84,March - $46.05,April - $48.16,May - $52.76,June - $42.64,July - $46.10,August - $43.23,September - $56.65,October - $49.34,November - $47.42,December - $53.41
  544. HOUSE PAYMENT,$746.00,Every┬áMonth
  545.  
  546. -- part contents for card part 7
  547. ----- text -----
  548. This is a demo or you would have been asked
  549. "Automatic cost adjustment for this expense?"  If you then clicked on yes The Stabilizer would make a card and ask you for the data needed to set up the yearly estimates for the next year's budget.  If you already had a cost adjustment card for this expense then you would have gone to that card.
  550.  
  551. -- part contents for card part 8
  552. ----- text -----
  553. This is a demo or you would have gone to the card for that month.  If you chose "Every Month" then you would have gotten a message that you can't go to every month at once.
  554.  
  555. -- part contents for card part 9
  556. ----- text -----
  557. You can't do anything with the amount from the pop-up menu.  You can't do anything with
  558. "Variable" either.
  559.  
  560. -- part contents for card part 11
  561. ----- text -----
  562. This is a demo or you would have been asked to
  563. "Please enter an expense item" followed by the sequence of dialog boxes designed to gather all the expense data for that item.
  564.  
  565. -- part contents for card part 15
  566. ----- text -----
  567. This is a Demo card.  But if it was not a Demo then if you clicked on the "House" button you would go to the "Home" card.  If you clicked on the "?" button you would go to the "Help Index" card.  If you clicked on the "Year Totals" button you would go to the "Year Totals" card.  If you clicked on the       button you would go to the
  568. "All Expenses" card, unless you are in the help section.  Then you would return to the card where you clicked on a "Help" button.  If you click on the "Go Back" button you will go back to the card you were at just before this one.
  569.  
  570. -- part contents for card part 1
  571. ----- text -----
  572. Auto Insurance
  573. Electricity
  574. House Payment
  575.  
  576. -- part contents for card part 2
  577. ----- text -----
  578. $346.57
  579. $52.84
  580. $746.00
  581.  
  582. -- part contents for card part 19
  583. ----- text -----
  584. You can view all the basic info for an expense item by holding the mouse down on an expense name in any list.  (You can also hold the mouse down on the name of the month at the top of the card.)  In a second or two a list will pop-up which is also a menu.  You can use it to go to a month card or to make or go to an estimated expense card.